import https from "./https"

class Classification extends https{
	
	storeType(){
		return this.request.post('/plugin/store/api_public/storeType')
	}
	typeStoreList(type){
		return this.request.post('/plugin/store/api_public/typeStoreList',{type})
	}

	//店铺列表
	storeList(page,store_name,selected=false,pagesize=30){
		return this.request.post('/plugin/store/api_public/storeList',{
			page,store_name,selected,pagesize
		})
	}
	//店铺详情
	storeDetail(store_id){
		return this.request.post('/plugin/store/api_public/storeDetail',{
			store_id,
			appid: getApp().globalData.appid,
			key: getApp().globalData.key
		})
	}
	
	
	//获取分类栏目名称
	getCatName(){
		return this.request.post('/plugin/goods/api_goods_cats/goodsCat',{
			
		})
	}
	
	//获取分类列表
	getGoodsCat(catid){
		return this.request.post('/plugin/goods/api_goods_cats/getGoodsCat',{
			catid
		})
	}
	
	//获取商品详情
	getGoodsDetail(id){
		return this.request.post('/plugin/goods/api_common/goodsDetail',{
			id,
			appid: getApp().globalData.appid,
			key: getApp().globalData.key
		})
	}
	
	//获取店铺商品列表
	getStoreList(form){
		form = Object.assign(form,{
			appid: getApp().globalData.appid,
			key: getApp().globalData.key
		})
		return this.request.post('/plugin/goods/api_common/goodsList',form,false)
	}
	
	//申请店铺
	applyStore(form){
		
		return this.request.post('/plugin/store/api_index/apply_store',{
			proof: uni.getStorageSync('token'),
			data: form
		},true)
	}
 
 
}
export default Classification